Add multi-architecture support for Docker images and workflows#841
Add multi-architecture support for Docker images and workflows#841stearz wants to merge 1 commit intokelos-dev:mainfrom
Conversation
There was a problem hiding this comment.
1 issue found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="Makefile">
<violation number="1" location="Makefile:108">
P2: `image-multiarch` hardcodes prebuilt arches (`amd64 arm64`) while `--platform` uses configurable `IMAGE_PLATFORMS`, which can produce missing per-arch binaries when platforms are overridden.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
This is a duplicate of #787 |
|
It would be cool if ypu merge one of them. 😉 |
.github/workflows/release.yaml
Outdated
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Set up QEMU |
There was a problem hiding this comment.
My experience with this in #787 was that QEMU is very, very slow. like 60 minutes per run.
I swapped to running on ARM runners, example: https://github.com/datagravity-ai/kelos/blob/prod/.github/workflows/ci.yaml and it went to 2-3 minutes.
There was a problem hiding this comment.
can we use a matrix strategy here for each architecture?
Makefile
Outdated
| IMAGE_ARCHES = $(shell echo "$(IMAGE_PLATFORMS)" | tr ',' '\n' | cut -d'/' -f2 | tr '\n' ' ') | ||
|
|
||
| .PHONY: image-multiarch | ||
| image-multiarch: ## Build and push multi-platform docker images via buildx (use WHAT to build specific image). |
There was a problem hiding this comment.
can we just use make image? I don't like to add two build rules for building the docker images.
.github/workflows/release.yaml
Outdated
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Set up QEMU |
There was a problem hiding this comment.
can we use a matrix strategy here for each architecture?
|
Hopefully 6bd4892 addresses the requested changes |
What type of PR is this?
/kind feature
What this PR does / why we need it:
adds support for arm64
Which issue(s) this PR is related to:
Fixes #840
Special notes for your reviewer:
none
Does this PR introduce a user-facing change?
yes, containers now also run on arm64 machines
Summary by cubic
Add multi-arch Docker builds (linux/amd64, linux/arm64) and rework CI to build per-arch images on native runners and publish a combined manifest, fixing #840. Images now run natively on ARM (Apple Silicon) and x86.
New Features
imagesupportsIMAGE_PLATFORMS; newmanifesttarget combines per-arch tags;PUSH=truepushes; defaults to host arch viaLOCAL_ARCH.ARG TARGETARCHand copy arch-specific binaries (*-linux-${TARGETARCH}).ubuntu-latestandubuntu-24.04-arm; tag per-arch images as<version>-<arch>; merge manifests; createlatestmanifest on tags; dropped QEMU; usedocker/setup-buildx-action@v3.Migration
make imagebuilds for your arch; override withLOCAL_ARCH=amd64or setIMAGE_PLATFORMS=linux/amd64,linux/arm64.PUSH=truewhen building, then runmake manifest VERSION=<v>to push the multi-arch tag.Written for commit 6bd4892. Summary will update on new commits.